{"ast":null,"code":"import React from\"react\";import{generateAvatarByNickname}from\"../../utils/helpers\";import'./Avatar.scss';import{jsx as _jsx}from\"react/jsx-runtime\";var Avatar=function Avatar(props){if(props.contentList&&props.contentList.items&&props.contentList.items.length>0){return/*#__PURE__*/_jsx(\"img\",{className:\"avatar\",src:props.contentList.items[0].link,alt:'Avatar '+props.alt});}else{var _generateAvatarByNick=generateAvatarByNickname(props.stringForGenerateColor),colors=_generateAvatarByNick.colors;var firstChar=props.stringForFirstCharacter[0].toUpperCase();return/*#__PURE__*/_jsx(\"div\",{style:{background:\"linear-gradient(135deg, \".concat(colors.color,\" 0%, \").concat(colors.colorLighten,\" 96.52%)\")},className:\"avatar avatar--symbol\",children:firstChar});}};export default Avatar;","map":{"version":3,"names":["React","generateAvatarByNickname","Avatar","props","contentList","items","length","link","alt","stringForGenerateColor","colors","firstChar","stringForFirstCharacter","toUpperCase","background","color","colorLighten"],"sources":["/Users/poppie/Desktop/development/messenger/app/frontend/src/components/Avatar/index.tsx"],"sourcesContent":["import React from \"react\";\nimport {AvatarProps} from \"../../models/props/AvatarProps\";\nimport { generateAvatarByNickname } from \"../../utils/helpers\";\nimport './Avatar.scss';\n\nconst Avatar: React.FC<AvatarProps> = (props) => {\n    if (props.contentList && props.contentList.items && props.contentList.items.length > 0) {\n        return (\n            <img className='avatar' src={props.contentList.items[0].link} alt={'Avatar ' + props.alt}/>\n        );\n    } else {\n        const {colors} = generateAvatarByNickname(props.stringForGenerateColor);\n        const firstChar = props.stringForFirstCharacter[0].toUpperCase();\n\n        return (\n            <div\n                style={{background: `linear-gradient(135deg, ${colors.color} 0%, ${colors.colorLighten} 96.52%)`}}\n                className='avatar avatar--symbol'\n            >\n                {firstChar}\n            </div>\n        );\n    }\n}\n\nexport default Avatar;\n"],"mappings":"AAAA,MAAOA,MAAK,KAAM,OAAO,CAEzB,OAASC,wBAAwB,KAAQ,qBAAqB,CAC9D,MAAO,eAAe,CAAC,2CAEvB,GAAMC,OAA6B,CAAG,QAAhCA,OAA6B,CAAIC,KAAK,CAAK,CAC7C,GAAIA,KAAK,CAACC,WAAW,EAAID,KAAK,CAACC,WAAW,CAACC,KAAK,EAAIF,KAAK,CAACC,WAAW,CAACC,KAAK,CAACC,MAAM,CAAG,CAAC,CAAE,CACpF,mBACI,YAAK,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAEH,KAAK,CAACC,WAAW,CAACC,KAAK,CAAC,CAAC,CAAC,CAACE,IAAK,CAAC,GAAG,CAAE,SAAS,CAAGJ,KAAK,CAACK,GAAI,EAAE,CAEnG,CAAC,IAAM,CACH,0BAAiBP,wBAAwB,CAACE,KAAK,CAACM,sBAAsB,CAAC,CAAhEC,MAAM,uBAANA,MAAM,CACb,GAAMC,UAAS,CAAGR,KAAK,CAACS,uBAAuB,CAAC,CAAC,CAAC,CAACC,WAAW,EAAE,CAEhE,mBACI,YACI,KAAK,CAAE,CAACC,UAAU,mCAA6BJ,MAAM,CAACK,KAAK,iBAAQL,MAAM,CAACM,YAAY,YAAU,CAAE,CAClG,SAAS,CAAC,uBAAuB,UAEhCL,SAAS,EACR,CAEd,CACJ,CAAC,CAED,cAAeT,OAAM"},"metadata":{},"sourceType":"module"}